package com.alita.utils;

/**
 * @Description: 字符串工具类
 * @Author: Luancx
 * @Date: 2022/02/17
 * @Version: 1.0.0
 */
public class MStrUtil {
    private MStrUtil() {
        throw new IllegalStateException("MStrUtil class");
    }
    public static boolean isEmpty(CharSequence cs) {
        return cs == null || cs.length() == 0;
    }

    public static boolean isNotEmpty(CharSequence cs) {
        return !isEmpty(cs);
    }

    public static boolean isBlank(CharSequence cs) {
        int strLen;
        if (cs != null && (strLen = cs.length()) != 0) {
            for (int i = 0; i < strLen; ++i) {
                if (!Character.isWhitespace(cs.charAt(i))) {
                    return false;
                }
            }
        }
        return true;
    }

    public static boolean isNotBlank(CharSequence cs) {
        return !isBlank(cs);
    }
}
